package com.cskaoyan.mapper;

import com.cskaoyan.bean.User;
import com.cskaoyan.bean.UserExample;

import java.sql.SQLException;
import java.util.List;

import com.cskaoyan.vo.UserStatVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    List<User> selectAllUser();


    List<UserStatVO.RowsBean> groupByAddTime();

    Integer selectUserIdByName(String username);

    @Select("select password from cskaoyanmall_user where username = #{username} ")
    String selectPasswordByUsername(String username);

    String getUsernameById(Integer id);

    @Select("SELECT count(1) FROM cskaoyanmall_user WHERE mobile = #{phone} ")
    int selectUserByMobile(String phone);
}